﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using com.fukefu;

namespace com.fukefu.Components
{
    public partial class UnicodeForm : BaseForm
    {
        private static UnicodeForm uf = null;
        private static Object syncObject = new Object();

        private UnicodeForm()
        {
            InitializeComponent();
        }
        public static UnicodeForm GetInstance()
        {
            if (uf == null || uf.IsDisposed)
            {
                lock (syncObject)
                {
                    if (uf == null || uf.IsDisposed)
                    {
                        uf = new UnicodeForm();
                    }
                }
            }
            return uf;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            textBox2.Text = MyFunction.Uncode(textBox1.Text);
            button1.Enabled = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            button2.Enabled = false;
            textBox2.Text = MyFunction.Encode(textBox1.Text);
            button2.Enabled = true;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Clipboard.SetDataObject(textBox2.Text);
        }
    }
}
